package com.buy.service.Impl;

import com.buy.FruitConstants;
import com.buy.service.BuyingProblem;
import com.buy.utile.ComputeUtil;

import java.util.Scanner;

public class BuyingProblemOne implements BuyingProblem {

    @Override
     public  void problem(){
        Integer result = 0;

         Scanner scanner = new Scanner(System.in); // 创建Scanner对象
         result = result +ComputeUtil.computeFruit(scanner,"苹果", FruitConstants.APPLE_PER,100);
         result = result +ComputeUtil.computeFruit(scanner,"草莓",FruitConstants.STRAWBERRIES_PER,100);

         System.out.println("需要支付购买的水果金额为"+result+"元");
     }



}
